home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / l2101a.zip / CASTLE3.REF < prev    next >
Text File  |  1997-06-23  |  11KB  |  598 lines

  1. ;note to .ref masters:
  2. ;replace castle3 with something else to use this .ref for other dwellings
  3. ;this .ref uses no long term vars, instead it makes its own data file - this
  4. ;means upgrading the game will not make people 'lose ownership' of their
  5. ;stuff.
  6.  
  7.  
  8. @#MYBANK
  9. ;team treasury
  10. @do moveback
  11. @do `p20 is 0
  12. @if tres3.dat exist true then do
  13.   @begin
  14.   @readfile tres3.dat
  15. `p20
  16.   @
  17.   @end
  18.  
  19. @clearblock 20 21
  20. @do move 3 21
  21. @do write
  22. `r0`2  Treasury is at `$$`p20`2 - (`0T`2)ake, (`0L`2)eave or (`0N`2)evermind? [`0N`2] :`%`x
  23. @do readspecial `s01 NTL
  24. @if `s01 is N then do
  25.  @begin
  26.  @do saybar
  27. You close the safe, carefully.
  28.  @closescript
  29.  @end
  30.  
  31. @if `s01 is T then do
  32.   @begin
  33.   @do move 5 23
  34.   @do write
  35. `0`r0Amount? `0: `%
  36.  @do readnum 10 0
  37.   @do `p21 is `v40
  38.   @if `p21 < 1 then `p21 is 0
  39.   @if `p21 > `p20 then do
  40.     @begin
  41.     @clearblock 21 24
  42.     @do saybar
  43. Not enough in here for that.
  44.     @closescript
  45.     @end
  46.  
  47.  @if `p21 is 0 then do
  48.    @begin
  49.     @clearblock 21 24
  50.     @do saybar
  51. You take nothing.
  52.     @closescript
  53.    @end
  54. //withdrawl.. we read from the file again so cheating won't be possible with
  55. //correct timing
  56.   @readfile tres3.dat
  57. `p20
  58.   @
  59.  
  60.   @if `p20 < `p21 then do
  61.     @begin
  62.     @clearblock 21 24
  63.     @do saybar
  64. Oh no!  Someone took the money while you were thinking about it!
  65.     @closescript
  66.     @end
  67.  
  68.     @do `p20 - `p21
  69.     @do money + `p21
  70.   @do delete tres3.dat
  71.   @writefile tres3.dat
  72. `p20
  73.   @
  74.     @clearblock 21 24
  75.     @do saybar
  76. `2You take `$`p21`2 from the treasury.
  77.  
  78. //if not owner, lets notify him
  79.  
  80. @readfile castle3.dat
  81. `p20
  82. `s01
  83. @
  84. ;load owner and current password
  85.  
  86. @if `p20 not &playernum then do
  87.   @begin
  88.    @writefile mail\mail`p20.dat
  89.   `0Wizard Tower Reports:
  90. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  91. `0  `n`2 has taken `$$`p21 `2from the treasury.
  92.  
  93.   @end
  94.   @closescript
  95.   @end
  96.  
  97. @if `s01 is L then do
  98.   @begin
  99.   @do move 5 23
  100.   @do write
  101. `0`r0Amount? `0: `%
  102.  @do readnum 10 &money
  103.   @do `p21 is `v40
  104.   @if `p21 < 1 then `p21 is 0
  105.   @if `p21 > money then do
  106.     @begin
  107.     @clearblock 21 24
  108.     @do saybar
  109. You are not carrying that much!
  110.     @closescript
  111.     @end
  112.  
  113.  @if `p21 is 0 then do
  114.    @begin
  115.     @clearblock 21 24
  116.     @do saybar
  117. You decide to leave nothing.  Ha!
  118.     @closescript
  119.    @end
  120.  
  121.   @do money - `p21
  122.  
  123. //deposit.. we read from the file again so cheating won't be possible with
  124. //correct timing
  125.   @readfile tres3.dat
  126. `p20
  127.   @
  128.   @do `p20 + `p21
  129.   @do delete tres3.dat
  130.   @writefile tres3.dat
  131. `p20
  132.   @
  133.     @clearblock 21 24
  134. //if not owner, lets notify him
  135.  
  136. @readfile castle3.dat
  137. `p20
  138. `s01
  139. @
  140. ;load owner and current password
  141.  
  142. @if `p20 not &playernum then do
  143.   @begin
  144.    @writefile mail\mail`p20.dat
  145.   `0Wizard Tower Reports:
  146. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  147. `0  `n`2 has deposited `$$`p21 `2to the treasury.
  148.  
  149.   @end
  150.  
  151.  
  152.     @do saybar
  153. `2You leave `$`p21`2 in the treasury.
  154.   @closescript
  155.  
  156.  
  157.   @end
  158.  
  159.  
  160. @#signhelp
  161. @do moveback
  162. @do saybar
  163. `0Sign: `2Be careful what you touch.
  164.  
  165. @#sign1
  166. @do moveback
  167. @do saybar
  168. `0Sign: `4Bonetown
  169.  
  170. @#sign2
  171. @do moveback
  172. @do saybar
  173. `0Sign: `9Porttown
  174. @#sign3
  175. @do moveback
  176. @do saybar
  177. `0Sign: `2Greentree
  178.  
  179. @#warpme
  180. @loadmap &map
  181. @drawmap
  182. @update
  183. @do quebar
  184. `%Wow, what a ride!
  185.  
  186. @#stone1
  187. ;Greentree
  188. @do x is 51
  189. @do y is 16
  190. @do map is 1356
  191. @do goto warpme
  192.  
  193. @#stone2
  194. ;Bonetown
  195. @do x is 68
  196. @do y is 5
  197. @do map is 1572
  198. @do goto warpme
  199.  
  200. @#stone3
  201. ;Porttown
  202. @do x is 62
  203. @do y is 13
  204. @do map is 956
  205. @do goto warpme
  206.  
  207.  
  208. @#TABLE
  209. ;get magic wand
  210. @do moveback
  211. @if castle3.dat exist false then do
  212.   @begin
  213.   @do saybar
  214. `0"Geeeet ouuut hoooman.." `2the table creaks.
  215.   @closescript
  216.   @end
  217.  
  218. ;load info on owner
  219. @readfile castle3.dat
  220. `p20
  221. `s01
  222. @
  223.  
  224. @if `p20 not &playernum then do
  225.   @begin
  226.   @do saybar
  227. `2What?  Touch something that isn't yours?  Um, no.
  228.   @closescript
  229.   @end
  230.  
  231. @if `i56 > 0 then do
  232.   @begin
  233.   @do saybar
  234. `2There is nothing on the table.
  235.   @closescript
  236.   @end
  237.  
  238. @do saybar
  239. A wand magically appears when you touch the table!  Yeah!
  240. @do `i56 is 1
  241.  
  242. @#FOUNTAIN
  243. ;free heal
  244. @offmap
  245. @do moveback
  246. @show
  247. `r0`c  `r1  The Fountain  `r0
  248.  
  249.   `2The strange water makes you tingle.
  250.  
  251.   `%YOU ARE COMPLETEY HEALED.
  252.  
  253. `k
  254. @do `p02 is `p03
  255. @drawmap
  256. @update
  257.  
  258.  
  259.  
  260. @#doorguard
  261. @do moveback
  262. @label startg
  263. ;guy who owns on it pushes against the door guard symbol.  This lets him
  264. ;control the password to gain entrance to the castle, as well as sell it
  265. ;back or transfer ownership.
  266. @if castle3.dat exist false then do
  267.   @begin
  268.   @do saybar
  269. `0"You must leave now, human," `2the troll commands.
  270.  @closescript
  271.   @end
  272.  
  273. @readfile castle3.dat
  274. `p20
  275. `s01
  276. @
  277. ;load owner and current password
  278.  
  279. @if `p20 not &playernum then do
  280.   @begin
  281.   @do saybar
  282. You wave to the troll, nice of it to let you in.
  283.   @closescript
  284.   @end
  285. @busy
  286.  
  287.  
  288. @do `v01 is 1 ;set default choice to 1
  289. @show
  290. `r0`c  `r1 Instructing your servants `r0
  291.  
  292.   `2The tiny troll snaps to attention when he sees you are going to
  293.   address him.
  294.  
  295. @do write
  296. `x`x
  297. @choice
  298. Set password to gain entrance (currently is `0`s01`%)
  299. Ownership options
  300. Leave
  301. @
  302. @if responce is 2 then do
  303.  @begin
  304.  @show
  305. `r0`c  `r1 Ownership Options `r0
  306.  
  307.   `2You retrieve your deed and carefully look it over.
  308.    
  309.    @do `v01 is 1
  310.    @do write
  311. `x`x
  312.    @choice
  313. Transfer deed to someone else
  314. Sell property back to the bank for `$20000`%.
  315. Do nothing of the sort
  316.  @if response is 1 then do
  317.    @begin
  318.    @show
  319. `\`\  `2Transfer to whom?
  320.    @chooseplayer `p20
  321.  
  322.    @if `p20 is 0 then do
  323.     @begin
  324.     @show
  325.   `2You decide to keep your domain - for now.`\`\`k
  326.     @do goto startg
  327.     @end
  328.    @do `s02 is getname `p20
  329.    @show
  330. `2  Are you sure you wish to give your tower to `0`s02`2?
  331. @do write
  332. `x`x
  333. @choice
  334. Yes
  335. Not on your life.
  336.  @if responce is 2 then do
  337.    @begin
  338.     @show
  339. `\`\  `2You decide to keep your domain - for now.`\`\`k
  340.     @do goto startg
  341.    @end
  342.  
  343.   @do delete castle3.dat
  344.   @writefile castle3.dat
  345. `p20
  346. `s01
  347. 0
  348. 0
  349. 0
  350. 0
  351.    @writefile mail\mail`p20.dat
  352.   `0Business note:
  353. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  354. `0  `n`2 has transferred ownership of Wizard Tower to you. 
  355.   Password to enter will remain `0"`s01"`2 unless
  356.   `2you come by and change it.
  357.  
  358.     @do addlog
  359.   `0`n`2 has given `%Wizard Tower`2 to `0`s02`2!
  360.      @routine seperate in gametxt.ref
  361.  
  362.     @show
  363. `\`\  `2Deed transfered.  Oh well - it was fun while it lasted.`\`\`k
  364.    @do goto done
  365.    @end
  366.   @if response is 2 then do
  367.     @begin
  368.     @show
  369. `\`\`2  Are you sure you wish to sell your tower back to the bank?`\
  370. @do `v01 is 1
  371. @do write
  372. `x`x
  373. @choice
  374. Yes
  375. Not on your life.
  376.  @if responce is 2 then do
  377.    @begin
  378.     @show
  379. `\`\  `2You decide to keep your domain - for now.`\`\`k
  380.     @do goto startg
  381.    @end
  382.  
  383.   @do delete castle3.dat
  384.   @do money + 20000
  385.   @show
  386. `\`\  `%TOWER SOLD!`2`\`\`k
  387.     @do addlog
  388.   `0`n`2 has sold `%Wizard Tower`2 back to the bank!
  389.     @routine seperate in gametxt.ref
  390.     @do goto done
  391.     @end
  392.  
  393.  
  394.   @do goto startg
  395.  @end
  396.  
  397. @if responce is 1 then do
  398.   @begin
  399.   @do write
  400. `\`\  `0"And the new password, s&sir?" `2(enter `4NONE`2 for no access to anyone)`\  `2Password:`x
  401.   @do readstring 40 `s01 `s01 
  402.   @do `p20 is length `s01
  403.   @if `p20 < 2 then do
  404.    @begin
  405.    @show
  406. `\`\  `2You decide the current password is ok.`\`\`k
  407.    @do goto startg
  408.    @end
  409.   @do delete castle3.dat
  410.   @writefile castle3.dat
  411. &playernum
  412. `s01
  413. 0
  414. 0
  415. 0
  416. 0
  417. @show
  418. `\`\  `0"Yes s&sir, I will not forget it!" `2the troll promises.`\`\`k
  419.    @do goto startg
  420.   @end
  421.  
  422. @drawmap
  423. @update
  424.  
  425. @#sign
  426. @do moveback
  427.  
  428.  @if castle3.dat exist false then do
  429.  @begin
  430.  @do saybar
  431. Wizard Tower - For sale cheap, enquire inside.
  432.  @end 
  433.  
  434. @if castle3.dat exist true then do
  435.  @begin
  436. @readfile castle3.dat
  437. `p20
  438. `s01
  439. @
  440. @do `s01 is getname `p20
  441.  @do saybar
  442. `2Property of `0`s01`2.
  443.  @end 
  444.  
  445. @#enter
  446. @do moveback
  447. @offmap
  448. @if castle3.dat exist false then do
  449.   @begin
  450.   @show
  451. `r0`c  `r1 `%For Sale `r0
  452.  
  453.   `2Wizard Tower may be old and dalapidated but it still houses that old 
  454.   world charm of an enchanters hostel.  Perhaps if you buy it, people would
  455.   call you 'that crazy old wizard who lives in that tower!'.  You just
  456.   can't put a price on that. (ok, it's `$$40,000`2)
  457.  
  458.   Buy now and recieve the following bonuses:
  459.  
  460.   `0* `2An indoor fountain.
  461.  
  462.   `0* `2A magic <maybe> wand the previous owner left.
  463.  
  464.   `0* `2Some strange rocks upstairs.
  465.  
  466. @do `v01 is 1
  467. @do write
  468. `x`x
  469. @choice
  470. >&money 39999 Purchase it.
  471. <&money 40000 Sigh wistfully and leave since you don't have enough.
  472. >&money 39999 Leave.
  473. @
  474.  
  475. @if responce is 1 then do
  476.   @begin
  477.   @if castle3.dat exist true then do
  478.     @begin
  479.     @show
  480. `\`\  `2Oh crap!  Someone bought it while you were thinking about it.  You
  481.   will regret your snail like thinking for the rest of your days.`\`\`k
  482.     @do goto done
  483.     @end
  484.  
  485.   @writefile castle3.dat
  486. &playernum
  487. NONE
  488. 0
  489. 0
  490. 0
  491. 0
  492.     @do money - 40000
  493.     @do addlog
  494.   `0`n `2buys `%Wizard Tower`2!
  495.      @routine seperate in gametxt.ref
  496.  
  497.   @show
  498. `r0`c  `r1 `%Why hello there, landowner! `r0
  499. `\`2  Nice job!  You now own this tower!
  500.  
  501.   `2Enjoy your new home.`\`\`k
  502.   @end
  503.  
  504. @label done
  505. @drawmap
  506. @update
  507. @closescript
  508.   @end
  509.  
  510. @readfile castle3.dat
  511. `p20
  512. `s01
  513. @
  514.  
  515. @do `p21 is deleted `p20
  516.  
  517. @if `p21 is 1 then do
  518.   @begin
  519.    ;owner got deleted!!!  Lets put it up for sale again.
  520.    @do delete castle3.dat
  521.     @do addlog
  522.   `%Wizard Tower`2 is put on the market today.
  523.      @routine seperate in gametxt.ref
  524.  
  525.    ;run script again
  526.    @do goto enter
  527.   @end
  528.  
  529. @if `p20 not &playernum then do
  530.   @begin
  531.   @do `s02 is getname `p20
  532.   @do upcase `s01
  533.   @if `s01 is NONE then do
  534.    @begin
  535.    @show
  536. `r0`c  `r1 None shall pass `r0
  537.  
  538.   `2You pound on the door for some time before you get an answer.
  539.  
  540.   `0"Master `s02`0 has declared that `4NO`0 visitors shall be allowed!" `2a
  541.   trollish voice calls from behind the wall.
  542.  
  543.   `4Ouch!
  544.  
  545. `k
  546.    @do goto done
  547.    @end
  548.  
  549.   @show
  550. `r0`c  `r1 Stand and unfold thyself `r0
  551.  
  552. `2  A head pops over the gate.  `0"Halt, you!  What business have you with
  553.   my lord and master, `%`s02`0?" `2a hunched over troll asks.
  554.  
  555. @do write
  556. `x`x
  557. @do `v01 is 1
  558. @choice
  559. Offer an explanation.
  560. Visit later.
  561.   @if response is 1 then do
  562.    @begin
  563.    @do write
  564. `\`\  `2Say what? :`x
  565.   @do readstring 40 NIL `s03 
  566.   @do upcase `s03
  567.   @do upcase `s01
  568.  
  569.   @if `s03 is `s01 then do
  570.     @begin
  571.     @show
  572. `\`\  `0"Welcome to `%Wizard Tower`0,"`2 the troll smiles as he opens the gate.`\`\`k
  573.     @do goto letmein
  574.     @end
  575.    @writefile mail\mail`p20.dat
  576.   `0Wizard Tower Reports:
  577. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  578. `0  `n`2 attempted to sweet talk the troll by saying
  579.   `0"`s03"`2.  `2He was `bNOT`2 allowed in.
  580.  
  581.    @show
  582. `\`\  `2The troll doesn't look too interested.`\`\`k
  583.    @do goto done
  584.    @end
  585.  
  586.   @do goto done
  587.  
  588.   @end
  589.  
  590. ;let him in
  591. @label letmein
  592. @do x is 44
  593. @do y is 17
  594. @do map is 1175
  595. @loadmap 1175
  596. @do goto done
  597. @#done
  598.